package com.umeox.watch.httpclient.core.client;


import com.umeox.watch.httpclient.core.constant.Scheme;
import com.umeox.watch.httpclient.core.exception.SdkException;

import java.util.List;

import okhttp3.Interceptor;

public class BaseClientInitialParam {
    String host;
    Scheme scheme;
    List<Interceptor> interceptors;
    long connectionTimeout = 30L;
    long readTimeout = 30L;
    long writeTimeout = 30L;

    public BaseClientInitialParam() {
    }

    public void check() {
        if (this.isEmpty(this.host) || null == this.scheme) {
            throw new SdkException("host and scheme must be initialed");
        }
    }

    private boolean isEmpty(String str) {
        return str == null || str.equals("");
    }

    public String getHost() {
        return this.host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public List<Interceptor> getInterceptors() {
        return interceptors;
    }

    public void setInterceptors(List<Interceptor> interceptors) {
        this.interceptors = interceptors;
    }

    public Scheme getScheme() {
        return this.scheme;
    }

    public void setScheme(Scheme scheme) {
        this.scheme = scheme;
    }

    public long getConnectionTimeout() {
        return this.connectionTimeout;
    }

    public void setConnectionTimeout(long connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public long getReadTimeout() {
        return this.readTimeout;
    }

    public void setReadTimeout(long readTimeout) {
        this.readTimeout = readTimeout;
    }

    public long getWriteTimeout() {
        return this.writeTimeout;
    }

    public void setWriteTimeout(long writeTimeout) {
        this.writeTimeout = writeTimeout;
    }

}
